Powerpoint Alchemy Amazing techniques and tips
Amazing techniques which will transform your use of PowerPoint presentations. Make your presentation stand out from the crowd!

About

Use vba to Split a Presentation into Single Slide Presentations

If you haven't already read How to Use vba Code you should do this first.

Sometimes, maybe for cataloguing you want to split presentations into a set of single slide presentations. There are several manual ways eg cut and paste into a new presentation or use Insert Slides from File to create new presentations. All of these will be extremely time consuming.

This vba does it in one go:

(As always use a copy of your presentation)

Sub singles()
Dim i As Integer
Dim osource As Presentation
Dim otarget As Presentation
'make a temp copy
ActivePresentation.SaveCopyAs (Environ("TEMP") _
& "\tempfile.ppt")
Set osource = Presentations.Open(Environ("TEMP") _
& "\tempfile.ppt")
For i = osource.Slides.Count To 1 Step -1
osource.Slides(i).Cut
Set otarget = Presentations.Add(msoTrue)
otarget.Slides.Paste
otarget.SaveAs (Environ("USERPROFILE") & _
"\Desktop\Slide " & CStr(i)) & ".ppt"
otarget.Close
Set otarget = Nothing
Next
osource.Close
'remove temp copy
Kill (Environ("TEMP") & "\tempfile.ppt")
Set osource = Nothing
End Sub

The use of environ for environmental variables can be extremely useful:

environ("TEMP") is the current user's local temp folder

environ ("USERPROFILE") is equivalent to C:\Documents and Settings\username or in Vista C:\Users\username

Note that if you cut or delete slides you must step BACKWARDS through the slides otherwise when you delete slide 3, slide 4 becomes the new slide 3!!



 


This website is sponsored by Technology Trish Ltd
© Technology Trish 2007
Registered in England and Wales No.5780175